# coding=utf-8
# author=haishan09@gmail.com
from dimension.providers.base import BaseProvider
from common.provider import provider_register


@provider_register('dimension', 'input')
class InputProvider(BaseProvider):

    def __init__(self, conf, dim):
        super(InputProvider, self).__init__(conf, dim)

    def get_choices(self, cuts={}):
        content = self.dim.dconf.get('content', '')
        for item in content.split('\n'):
            kv = item.strip('\r').split(',')
            if len(kv) == 2:
                yield kv

